class CommonParams {
  // 平台业务字段
  public static readonly tokenName = 'authorization';
  public static readonly userIdName = 'userid';
  public static readonly userName = 'userName';
  public static readonly loginUserName = 'loginUser';
  public static readonly preRouterName = 'preRouter';
  public static readonly afterRouterName = 'afterRouter';
  public static readonly REQUEST_SUCCESS = 1;
  public static readonly REQUEST_FAIL = 0;
  public static readonly REQUEST_ERROR = -1;
  public static readonly POSITIONS = [
    {id: 1, name: '1号位'},
    {id: 2, name: '2号位'},
    {id: 3, name: '3号位'},
    {id: 4, name: '4号位'},
    {id: 5, name: '5号位'},
  ];
  public static readonly ALI_ICON_FONT_URL = '//at.alicdn.com/t/font_1755678_5t6sq8z2j1a.js';
}

/**
 * api地址
 */
class ApiList {
  public static readonly LOGIN = '/auth/login';
  public static readonly HEAT_BEAT = '/common/heatBeat';
  public static readonly SUBMIT_GAME = '/game/submit';
  public static readonly GET_IF_LAST_GAME_NOT_FINISH = '/game/getIfLastGameNotFinish';
}

/**
 * websocket消息类型
 */
class MessageParams {
  public static readonly MESSAGE_TYPE = {
    join: 1, // 人员进入
    leave: 2, // 人员离开
    prepare: 3, // 其他人状态变更
    cancelPrepare: 4, // 其他人状态变更
    distribution: 5, // 分配位置（服务端返回结果）
    gameResult: 6, // 设置比赛结果
    kickOut: -1, // 踢下线
    offline: 7, // 服务器端下线
    error: 8, // 服务器端错误
  };
}

export {CommonParams, ApiList, MessageParams};
